﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" EnableViewState="true"
    Inherits="System.Web.Mvc.ViewPage<Gman.WebApp.Models.SedeModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script src="../../Scripts/Binding/Sede.js" type="text/javascript"></script>

<script type="text/javascript">
    var guid = "<%= Model.ID.ToString()%>";
    var action = "<%= Model.Action.ToString()%>";

    $(document).ready(function() {
        SetupControls();
        SetupActions();
        SetupDropDowns();

        $("#AddPersonal").click(function() {
            LoadAddOrEditPersonal(null);
        });

    });
</script>

<div style="margin-top: 5px;">
    <div class="DataTop">
        <div class="DataTopLeft">
        </div>
        <div class="DataTopRight">
        </div>
    </div>
    <div class="DataContent">
        <div class="DataContentRight" style="height: 50px;">
            <b>Sedes </b>
            <% Html.RenderPartial("ToolBar", Model.ToolBar); %>
        </div>
    </div>
    <div class="DataBottom">
        <div class="DataBottomLeft">
        </div>
        <div class="DataBottomRight">
        </div>
    </div>
</div>
<div style="margin-top:5px;">
    <div class="DataTop">
        <div class="DataTopLeft">
        </div>
        <div class="DataTopRight">
        </div>
    </div>
    <div class="DataContent">
        <div class="DataContentRight">
            <div class="DataTable">

                <fieldset>
                    <table width="100%">
                        <tr>
                            <td>
                                <div class="editor-label">
                                    Sede/Tienda
                                </div>
                            </td>
                            <td>
                                <div>
                                    <%= Html.TextBoxFor(model => model.Sede.CodSede, new { style = "width: 60%;", propertyname = "Sede.CodSede", ID = "Sede_CodSede" })%>
                                    
                                    <img id="btnBuscar" src="../../_Images/Search-icon-16.png" alt="Buscar sede" style="cursor: pointer;" />
                                </div>                                  
                            </td>
                            <td>
                                
                            </td>
                            <td>
                                 
                            </td>
                         </tr>
                        <tr>
                            <td>
                                <div class="editor-label">
                                    Nombre/Sede
                                </div>
                            </td>
                            <td width="200px">
                                <%= Html.TextBoxFor(model => model.Sede.NomSede, new { style = "width: 90%;", propertyname = "Sede.NomSede", ID = "Sede_CodSede" })%>
                            </td>   
                        </tr>                    
                        <tr>                            
                            <td>
                                <div class="editor-label">
                                    Departamento
                                </div>
                            </td>
                            <td style="width: 450px">
                                <div>
                                    <%= Html.DropDownListFor(model => model.Ubigeo.CodDpto, Model.Departamento, new { style = "width: 60%;", propertyname = "Ubigeo.CodDpto" })%>
                                </div>
                            </td>
                         </tr>
                        <tr>
                            <td style="width: 150px;">
                                <div class="editor-label">
                                    Provincia</div>
                            </td>
                            <td style="width: 450px">
                                <div>
                                    <%= Html.DropDownListFor(model => model.Ubigeo.CodProv, Model.Provincia, new { style = "width: 60%;", propertyname = "Ubigeo.CodProv" })%>
                                </div>
                            </td>
                         </tr>
                        <tr>
                            <td style="width: 150px;">
                                <div class="editor-label" style="float: right">
                                    Distrito
                                </div>
                            </td>
                            <td style="width: 450px">
                                <div>
                                    <%= Html.DropDownListFor(model => model.Ubigeo.CodDist, Model.Distrito, new { style = "width: 60%;", propertyname = "Ubigeo.CodDist" })%>
                                </div>
                            </td>
                            <td>
                            </td>
                          </tr>                                
                        <tr>
                            <td style="width: 66px">
                                <div class="editor-label">
                                    Dirección
                                </div>
                            </td>
                            <td class="TdCampo">
                                <%= Html.TextBoxFor(model => model.Sede.DirecSede, new { style = "width: 90%;", propertyname = "Sede.DirecSede" })%>
                            </td>
                         </tr>
                        <tr>
                            <td>
                                <div class="editor-label" style="float: right">
                                    Teléfono
                                </div>
                            </td>
                            <td class="TdCampo">
                                <%= Html.TextBoxFor(model => model.Sede.TlfSede, new { style = "width: 60%;", propertyname = "Sede.TlfSede" })%>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>   
        </div>
    </div>    
    <div class="DataContent">
        <div class="DataContentRight" style="height: 300px;">
            <br />
            <b>Personal de Sede / Tienda </b> 
            <input id="AddPersonal" type="submit" value="Adicionar" style="float:right;"/>            
            <div id="ListaPersonalDiv">
             <% Html.RenderPartial("ListaPersonal", Model); %>         
             </div>
        </div>
    </div>    
    <div class="DataBottom">
        <div class="DataBottomLeft">
        </div>           
        <div class="DataBottomRight">
        </div>
    </div>
</div>
<div id="PersonalPopupDiv">
</div>
</asp:Content>
